home *** CD-ROM | disk | FTP | other *** search
-
-
-
- TEST ST-UNIX User's Manual TEST
-
-
-
- COMMAND
- test - general condition test
-
- FORMAT
- test expr
-
- DESCRIPTION
- _✓T_✓e_✓s_✓t evaluates the condition _✓e_✓x_✓p_✓r, and if the value is true
- test returns zero exit status, else an exit status of 1 is
- returned.
-
- The following conditions can be used to form an expression.
-
- -r file
- if the file exists is true.
-
- -f file
- same as -r.
-
- -w file
- if the file exists and is writable returns true.
-
- -d file
- if the file is a directory returns true.
-
- -s file
- if the file is larger than zero bytes returns true.
-
- -z string
- if length of string is zero return true.
-
- -n s1
- is length of string is non zero is true.
-
- sstring1 = string2
- if both string are equal returns true.
-
- string1 != string2
- if both strings are not equal returns true.
-
- string
- is string is not null returns true. So test with no
- arguments return false.
-
- number1 -eq number2
- if numbers are equal is true. Other comparisons are:
- -gt, -ge, -lt, -le, and -ne.
-
- The operators may be combined with: ! (negation), -a (logi-
- cal and), and -o (logical or). Expressions may be grouped
- with parenthesis.
-
-
-
-
- Printed 10/April/1987 1 April 1987 1
-
-
-
-